﻿<html>  
<title>控件化</title>  
<head> 
<link rel="stylesheet" type="text/css" href="../js/jquery/jquery_autocomplete/jquery.autocomplete.css" />
<link rel="stylesheet" type="text/css" href="../js/jquery/jquery_autocomplete/lib/thickbox.css" />
<script type="text/javascript" src="../js/jquery/jquery-1.4.4.min.js"></script>
<script type='text/javascript' src='../js/jquery/jquery_autocomplete/lib/jquery.bgiframe.min.js'></script>
<script type='text/javascript' src='../js/jquery/jquery_autocomplete/lib/jquery.ajaxQueue.js'></script>
<script type='text/javascript' src='../js/jquery/jquery_autocomplete/lib/thickbox-compressed.js'></script>
<script type='text/javascript' src='../js/jquery/jquery_autocomplete/jquery.autocomplete.js'></script>
<script type="text/javascript">
	$(document).ready(function() {
		$("#order_customName").autocomplete("queryCustomerNames.action", {
			width: 150,
			max: 10,
			autoFill: false,
			dataType: "json",
			parse: function(data) {
				var parsed = [];
				var rows = data.customerList;
				for (var i=0; i < rows.length; i++) {
					var row = rows[i];
					if (row) {
						parsed[parsed.length] = {
							data: row,
							value: row[0],
							result: row[1]//最终选择后显示的内容
						};
					}
				}
				return parsed;
			},
			formatItem: function(row, i, max) {
				return "" + row[2] + row[1];//列表中显示的值
			}
		}).result(function(e, row) {
			$(e.target).next().val(row[0]);//最终选择的ID
		});
	});
</script>
</head> 

<body>  
<div id="ffb1"></div>
<input type="text" id="order_customName" />
<input type="text"  />
<p>你选择结果：<font color=red><strong id="SelValue" ></strong></font></p>
</body> 


</html>